﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:OMANE.Modules.Builder"
	mc:Ignorable="d"
	x:Class="ViewModeleInterne"
	d:DesignWidth="640" d:DesignHeight="480">

    
    <Grid DataContext="{Binding Model.DefaultEntity}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="250"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="5"/>
            <RowDefinition MinHeight="100" Height="Auto"/>
        </Grid.RowDefinitions>


        <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" Grid.ColumnSpan="2" />
        <DataGrid Grid.ColumnSpan="2" AutoGenerateColumns="False" ItemsSource="{Binding Properties}" IsSynchronizedWithCurrentItem="True" >
            <DataGrid.Columns>
                <DataGridCheckBoxColumn MinWidth="30" Binding="{Binding IsKey}"/>
                <DataGridTextColumn Header="Nom du Champ" MinWidth="100" FontFamily="Calibri" FontSize="16" FontWeight="Bold" Binding="{Binding Name}"/>
                <DataGridComboBoxColumn Header="Type Du Champ" MinWidth="100" SelectedItemBinding="{Binding Type}" >
                	<DataGridComboBoxColumn.ItemsSource>
                        <x:Array Type="{x:Type local:ModelParamUnderLyingType}">
                            <local:ModelParamUnderLyingType>Double</local:ModelParamUnderLyingType>
                            <local:ModelParamUnderLyingType>Case</local:ModelParamUnderLyingType>
                            <local:ModelParamUnderLyingType>Boolean</local:ModelParamUnderLyingType>
                            <local:ModelParamUnderLyingType>Time</local:ModelParamUnderLyingType>
                            <local:ModelParamUnderLyingType>Date</local:ModelParamUnderLyingType>
                            <local:ModelParamUnderLyingType>Mixed</local:ModelParamUnderLyingType>
                            <local:ModelParamUnderLyingType>Uncertain</local:ModelParamUnderLyingType>
                        </x:Array>         	
					</DataGridComboBoxColumn.ItemsSource>            
				</DataGridComboBoxColumn>
                <DataGridTextColumn Header="Description" Width="*" Binding="{Binding Description}"/>
            </DataGrid.Columns>
        </DataGrid>
        <DataGrid
            CanUserAddRows="False" 
            CanUserDeleteRows="False" 
            CanUserReorderColumns="False" 
            CanUserSortColumns="False" 
            CanUserResizeColumns="True" 
            HeadersVisibility="Column" 
            AutoGenerateColumns="False"  
            Grid.Row="3" 
            ItemsSource="{Binding Properties/Details}" 
            GridLinesVisibility="Vertical">
            <DataGrid.Columns>
                <DataGridTextColumn MinWidth="50" IsReadOnly="True" Binding="{Binding Name}" />
                <DataGridTextColumn Width="*"  Binding="{Binding Path=Value, Mode=TwoWay}" />
            </DataGrid.Columns>
        </DataGrid>
        <TextBlock Grid.Row="2" Grid.Column="1" Text="Help Zone" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18.667" FontFamily="Stencil" />
    </Grid>


</UserControl>